import request from '@/utils/request'

// 创建正式仓
export function createStorageFormalWarehouse(data) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新正式仓
export function updateStorageFormalWarehouse(data) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/update',
    method: 'put',
    data: data
  })
}

// 删除正式仓
export function deleteStorageFormalWarehouse(id) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得正式仓
export function getStorageFormalWarehouse(id) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得正式仓分页
export function getStorageFormalWarehousePage(query) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/page',
    method: 'get',
    params: query
  })
}

// 导出正式仓 Excel
export function exportStorageFormalWarehouseExcel(query) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 正式仓调拨
export function pcAllot(data) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/pcAllot',
    method: 'post',
    data: data
  })
}

// 正式仓报损
export function pcDamage(data) {
  return request({
    url: '/pekingfish/storage-formal-warehouse/pcDamage',
    method: 'post',
    data: data
  })
}

// 下载用户导入模板
export function importTemplateOrder() {
  return request({
    url: '/pekingfish/storage-formal-warehouse/get-import-template',
    method: 'get',
    responseType: 'blob'
  })
}
